<div class="row-fluid">
	<div class="span12">
            <fieldset>
                <legend>#i18n{portal.workgroup.assign_users.pageTitle} "${workgroup.key}" 
				<small>${workgroup.description} | #i18n{portal.workgroup.assign_users.workgroup.number_user} : ${assigned_users_number}</small>
                <span class="pull-right">
					<a class="btn btn-primary btn-small" href="jsp/admin/workgroup/ModifyWorkgroup.jsp?workgroup_key=${workgroup.key}"  title="#i18n{portal.workgroup.manage_workgroups.buttonLabelModify}" ><i class="icon-edit icon-white"></i></a>
					<a class="btn btn-danger btn-small" href="jsp/admin/workgroup/RemoveWorkgroup.jsp?workgroup_key=${workgroup.key}"  title="#i18n{portal.workgroup.manage_workgroups.buttonLabelDelete}" ><i class="icon-trash icon-white"></i></a>
				</span>
				</legend>
            </fieldset>
		<div class="row-fluid">
		<div class="span3">
		<@item_navigation item_navigator=item_navigator />
        <!--  -->
		<#if assigned_users_list?size &gt; 0 || search_is_search >
			<fieldset>
                <legend>
                    #i18n{portal.workgroup.assign_users.labelAssignedUser}
                </legend>
                <form  method="post" name="search_users" action="jsp/admin/workgroup/AssignUsersWorkgroup.jsp"  >
                <#if (user_levels?has_content)>
                <label for="user_level">#i18n{portal.users.manage_users.search_users.userLevelLabel} :</label>
                <select id="user_level" name="search_user_level">
					<#if (search_admin_user_filter.userLevel > -1) >
						<option value="noValue" >#i18n{portal.users.manage_users.search_users.labelAllLevels}</option>
                        <#list user_levels as user_level>
							<#if (search_admin_user_filter.userLevel == user_level.id) >
                                <option value="${user_level.id}" selected="selected" >${user_level.name}</option>
                            <#else>
                                <option value="${user_level.id}" >${user_level.name}</option>
                            </#if>
                        </#list>
                    <#else>
						<option value="noValue" selected="selected" >#i18n{portal.users.manage_users.search_users.labelAllLevels}</option>
                        <#list user_levels as user_level>
							<option value="${user_level.id}" >${user_level.name}</option>
                        </#list>
                    </#if>
                    </select>
                </#if>
                <label or="access_code" >#i18n{portal.users.manage_users.search_users.labelAccessCode} :</label>
                <input type="text" id="access_code" name="search_access_code" value="${search_admin_user_filter.accessCode}" />
                <label for="last_name" >#i18n{portal.users.manage_users.search_users.labelLastName} :</label>
                <input type="text"  id="last_name" name="search_last_name" value="${search_admin_user_filter.lastName}" maxlength="100" class="input-normal" tabindex="2" />
                <label for="first_name">#i18n{portal.users.manage_users.search_users.labelFirstName} :</label>
                <input type="text" id="first_name" name="search_first_name" value="${search_admin_user_filter.firstName}" maxlength="100" class="input-normal" tabindex="3" />
				<label for="email">#i18n{portal.users.manage_users.search_users.labelEmail} :</label>
                <input type="text" id="email" name="search_email" value="${search_admin_user_filter.email}" maxlength="100" class="input-normal" tabindex="4" />
                <label for="status">#i18n{portal.users.manage_users.search_users.labelStatus} :</label>
                <select id="status" name="search_status" tabindex="5">
				<#switch search_admin_user_filter.status >
					<#case 0 >
						<option value="noValue" >#i18n{portal.users.manage_users.search_users.labelAllStatus}</option>
                        <option value="0" selected="selected" >#i18n{portal.users.create_user.statusLabelEnabled}</option>
                        <option value="1" >#i18n{portal.users.create_user.statusLabelDisabled}</option>
                    <#break>
                    <#case 1 >
                        <option value="noValue" >#i18n{portal.users.manage_users.search_users.labelAllStatus}</option>
                        <option value="0" >#i18n{portal.users.create_user.statusLabelEnabled}</option>
                        <option value="1" selected="selected" >#i18n{portal.users.create_user.statusLabelDisabled}</option>
                    <#break>
                    <#default>
						<option value="noValue" selected="selected" >#i18n{portal.users.manage_users.search_users.labelAllStatus}</option>
						<option value="0" >#i18n{portal.users.create_user.statusLabelEnabled}</option>
                        <option value="1" >#i18n{portal.users.create_user.statusLabelDisabled}</option>
                    <#break>
                </#switch>
                </select>
                <#list attributes_list as attribute>
					<#if attribute.shownInSearch>
						${attribute.getHtmlFormSearchAttribute( search_admin_user_field_filter, locale )}
                    </#if>
                </#list>
				<input type="hidden" name="workgroup_key" value="${workgroup.key}" />
                <button class="btn btn-primary btn-small" type="submit" " tabindex="6" name="search_is_search"/> 
					<i class="icon-search icon-white"></i>
					#i18n{portal.users.manage_users.search_users.buttonSearch}
                </button>
                </form>
            </fieldset>
        </div>
        <div class="span9">
		<#if users_list?size &gt; 0 >
			<form name="assignUser" method="post" action="jsp/admin/workgroup/DoAssignUsersWorkgroup.jsp">
            <input type="hidden" name="workgroup_key" value="${workgroup.key}" />
			<label>#i18n{portal.workgroup.assign_users.labelAvailableUser}</label>
            <@comboWithParamsAndLength name="list_users" default_value="" additionalParameters="multiple='multiple' size='10' style='width:100%;'" items=users_list max_length=175 />
            <button type="submit" class="btn btn-primary btn-small"><i class="icon-ok icon-white"></i>&nbsp;#i18n{portal.workgroup.assign_users.labelButtonValidate}</button>
            <button type="button" name="cancel" class="btn btn-primary btn-small"><i class="icon-remove-circle icon-white"></i>&nbsp;#i18n{portal.admin.message.buttonCancel}</button>
            </form>
        <#else>
            <p class="label label-warning">#i18n{portal.workgroup.assign_users.noUserToAssign}</p>
        </#if>
            <fieldset>
                <form class="form-horizontal" method="post" action="jsp/admin/workgroup/AssignUsersWorkgroup.jsp">
                    <@paginationAdmin paginator=paginator combo=1 form=0 />
                    <#if search_is_search >
                    <input type="hidden" name="search_is_search" value="true"/>
                    <input type="hidden" name="search_user_level" value="${search_admin_user_filter.userLevel}"/>
                    <input type="hidden" name="search_access_code" value="${search_admin_user_filter.accessCode}"/>
                    <input type="hidden" name="search_last_name" value="${search_admin_user_filter.lastName}"/>
                    <input type="hidden" name="search_first_name" value="${search_admin_user_filter.firstName}"/>
                    <input type="hidden" name="search_email" value="${search_admin_user_filter.email}"/>
                    <input type="hidden" name="search_status" value="${search_admin_user_filter.status}"/>
                    </#if>
                    <#if search_admin_user_field_filter.listUserFields?exists && search_admin_user_field_filter.listUserFields?has_content>
                    <#list search_admin_user_field_filter.listUserFields as user_field>
                    <#if user_field.attribute.attributeType.className == "fr.paris.lutece.portal.business.user.attribute.AttributeComboBox">
                    <input type="hidden" name="attribute_${user_field.attribute.idAttribute}" value="${user_field.attributeField.idField}"/>
                    <#else>
                    <input type="hidden" name="attribute_${user_field.attribute.idAttribute}" value="${user_field.value}" />
                    </#if>
                    </#list>
                    </#if>
                    <input type="hidden" name="workgroup_key" value="${workgroup.key}" />
            </fieldset>
            </form>
            <table class="table table-striped table-condensed">
                <tr>            
                    <th>
                        #i18n{portal.users.manage_users.columnTitleLastName}
                        <@sort jsp_url="jsp/admin/workgroup/AssignUsersWorkgroup.jsp" attribute="lastName&workgroup_key=${workgroup.key}${sort_search_attribute}" />
                    </th>
                    <th>
                        #i18n{portal.users.manage_users.columnTitleFirstName}
                        <@sort jsp_url="jsp/admin/workgroup/AssignUsersWorkgroup.jsp" attribute="firstName&workgroup_key=${workgroup.key}${sort_search_attribute}" />
                    </th> 
                    <th>
                        #i18n{portal.users.manage_users.columnTitleAccessCode}
                        <@sort jsp_url="jsp/admin/workgroup/AssignUsersWorkgroup.jsp" attribute="accessCode&workgroup_key=${workgroup.key}${sort_search_attribute}" />
                    </th>        
                    <th>
                        #i18n{portal.users.manage_users.columnTitleEmail}
                        <@sort jsp_url="jsp/admin/workgroup/AssignUsersWorkgroup.jsp" attribute="email&workgroup_key=${workgroup.key}${sort_search_attribute}" />
                    </th>
                    <th>#i18n{portal.users.manage_users.columnTitleActions}</th>
                </tr>
                <#list assigned_users_list as assigned_user>
					<#if assigned_user_has_next>
						<#assign anchor = assigned_user_index>
					<#else>
						<#assign anchor = assigned_user_index - 1 >
					</#if>
                <tr id="anchor-${assigned_user_index}">
                    <td>${assigned_user.lastName}</td>
                    <td>${assigned_user.firstName}</td>
                    <td>${assigned_user.accessCode}</td>
                    <td>${assigned_user.email}</td>	                
                    <td>
                        <a class="btn btn-primary btn-small" href="jsp/admin/user/ModifyUser.jsp?id_user=${assigned_user.userId}"  title="#i18n{portal.workgroup.assign_users.actionModify}" >
                            <i class="icon-edit icon-white"></i>
                        </a>

                        <a class="btn btn-danger btn-small" href="jsp/admin/workgroup/DoUnassignUser.jsp?id_user=${assigned_user.userId}&workgroup_key=${workgroup.key}&anchor=anchor-${anchor}"  title="#i18n{portal.workgroup.assign_users.actionUnassign}" >
                            <i class="icon-trash icon-white"></i>
                        </a>

                    </td>
                </tr>            
                </#list>
            </table>
            <@paginationAdmin paginator=paginator />
        <#else>
			</div>
			<div class="span9">
			<p class="label label-warning">#i18n{portal.workgroup.assign_users.noAssignedList}</p>
        </#if>
		<!--  -->		
        </div>	
		</div>
	</div>
</div>